import fetch from 'common/src/utils/fetch'

let api = {
    // 查询列表
    getList(data) {
        return fetch({
            url: '/api/designservice/scoreWeight/list',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 复制
    copy(grade) {
        return fetch({
            url: `/api/designservice/scoreWeight/copy?grade=${grade}`,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            }
        })
    },
    // 导出
    export(data) {
        return fetch({
            url: '/api/designservice/scoreWeight/export',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 批量修改
    update(data) {
        return fetch({
            url: '/api/designservice/scoreWeight/batchUpdate',
            method: 'put',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    getExportStatus(key) {
        return fetch({
            url: `/api/designservice/common/exportExcelResult/${key}`,
            method: 'get',
            showMask: false
        })
    },
    // 查数据字典
    queryDic(data) {
        let authId = localStorage.getItem('activeAuthId')
        if (authId) {
            data['authId'] = authId
        }
        return fetch({
            url: '/api/commonservice/dictionary/query',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 根据年份和学院查专业
    getSubject(data) {
        return fetch({
            url: '/api/designservice/common/findSubject',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    }
}

export default api
